Check for title validity in ApiQueryCategories
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 25 Mar 2009 13:43:45 +0000 (13:43 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 25 Mar 2009 13:43:45 +0000 (13:43 +0000)
includes/api/ApiQueryCategories.php

index d6f6177..d8bd1cd 100644 (file)
@@ -87,7 +87,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                        foreach($params['categories'] as $cat)
                        {
                                $title = Title::newFromText($cat);
-                               if($title->getNamespace() != NS_CATEGORY)
+                               if(!$title || $title->getNamespace() != NS_CATEGORY)
                                        $this->setWarning("``$cat'' is not a category");
                                else
                                        $cats[] = $title->getDBkey();
@@ -239,4 +239,4 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
-}
\ No newline at end of file
+}